<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>parse_format (Spec::Runner::Options)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File vendor\plugins\rspec/lib/spec/runner/options.rb, line 111</span>
      <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_format</span>(<span class="ruby-identifier">format_arg</span>)
        <span class="ruby-identifier">format</span>, <span class="ruby-identifier">where</span> = <span class="ruby-identifier">split_at_colon</span>(<span class="ruby-identifier">format_arg</span>)
        <span class="ruby-comment cmt"># This funky regexp checks whether we have a FILE_NAME or not</span>
        <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">where</span>.<span class="ruby-identifier">nil?</span>
          <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;When using several --format options only one of them can be without a file&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@out_used</span>
          <span class="ruby-identifier">where</span> = <span class="ruby-ivar">@out</span>
          <span class="ruby-ivar">@out_used</span> = <span class="ruby-keyword kw">true</span>
        <span class="ruby-keyword kw">end</span>

        <span class="ruby-identifier">formatter_type</span> = <span class="ruby-constant">BUILT_IN_FORMATTERS</span>[<span class="ruby-identifier">format</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">load_class</span>(<span class="ruby-identifier">format</span>, <span class="ruby-value str">'formatter'</span>, <span class="ruby-value str">'--format'</span>)
        <span class="ruby-ivar">@formatters</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">formatter_type</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">where</span>)
      <span class="ruby-keyword kw">end</span></pre>
</body>
</html>